<template>
  <page-container :isback="true"  :base-tab="2" :shownav="true" navtitle="我参与的活动" :istabbox="false">
    <div class="content_container">
      <div style="margin-bottom: 20rpx">
        <u-search @search="getDoingCards" placeholder="请输入关键字" v-model="keyword" :showAction="false"></u-search>
      </div>
      <div  v-show="Array.isArray(cardListData) && cardListData.length > 0">
        <div v-for="item in cardListData" :key="item.id">
          <DoingsCard class="doings_card"
                      :cardData="item"
          ></DoingsCard>
        </div>
      </div>
      <empty v-show="cardListData == null || cardListData.length <= 0"></empty>
    </div>
  </page-container>
</template>

<script>

import DoingsCard from "../../components/doingsCard/index.vue";
import {getQueryHeaders, requestGet} from "@/util/means/request";
import {eventDetailsPage} from "@/util/publicConfig";
import Empty from "@/components/empty/index.vue";
export default {
  name: "index",
  components:{
    Empty,
    DoingsCard,
  },
  data() {
    return {
      activityTargetType:"",
      keyword:'',
      eventDetailsPage,
      cardListData:[

      ],
    }
  },
  computed(){

  },
  created() {
  },
  mounted() {

    //获取用户信息
    this.activityTargetType = this.$store.state.$userInfo.id;

    //获取活动信息
    this.getDoingCards();


  },

  methods: {

    getDoingCards(){
      let params = {
        keyword:this.keyword,
        activityTargetType:this.activityTargetType,
        pageNo:1,
        pageSize:200
      }
      requestGet({url: "/activity/queryMyActivity", data: params,header:getQueryHeaders()}).then(res => {
        console.log(res);
        this.cardListData = res.records;
      },err=>{
        console.log(err,'==============')
      })
    }
  },
}
</script>

<style scoped lang="scss">


.content_container{
  width:100%;
  height: 100%;
  overflow: auto;
  padding-left: 30rpx;
  padding-top: 30rpx;
  padding-right: 30rpx;
  box-sizing: border-box;

  .doings_card{
    width: 100%;
    height: 433rpx;
    background-color: #FFFFFF;
    margin-bottom: 30rpx;
    border-radius:20rpx;
  }
}
</style>
